
#ifndef __B_HAL_RTC_H
#define __B_HAL_RTC_H

#ifdef __cplusplus
extern "C" {
#endif

/*Includes ----------------------------------------------*/
#include "b_hal.h"

/**
 * \addtogroup B_HAL
 * \{
 */

/**
 * \addtogroup RTC
 * \{
 */

/**
 * \defgroup RTC_Exported_Types
 * \{
 */

typedef struct
{
    uint8_t year;   /* 0-99 */
    uint8_t month;  /* 1-12 */
    uint8_t day;    /* 1-31 */
    uint8_t hour;   /* 0-23 */
    uint8_t minute; /* 0-59 */
    uint8_t second; /* 0-59 */
    uint8_t weekday;/* 0-6, 0=Sunday */
} bRtcTime_t;

/**
 * \}
 */

/**
 * \defgroup RTC_Exported_Functions
 * \{
 */

int bHalRtcInit(void);
int bHalRtcSetTime(bRtcTime_t *time);
int bHalRtcGetTime(bRtcTime_t *time);
int bHalRtcSetAlarm(bRtcTime_t *time);
int bHalRtcGetAlarm(bRtcTime_t *time);
int bHalRtcEnableAlarm(uint8_t enable);

/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */

#ifdef __cplusplus
}
#endif

#endif /* __B_HAL_RTC_H */

/************************ Copyright (c) 2024 Bean *****END OF FILE****/ 